/**********************************************************
If the input is void, generate a param file

*****************************************************************/

using namespace std;

void generate_param(){

  cout<<"SLUG: Give me a .param file or use './slug def'!"<<endl;
  cout<<"I'll print a default slug.param for you..."<<endl;

  //open file
  ofstream fp_out;
  fp_out.open("slug.param", ios::out);
  
  //start
  fp_out  << "####\n#SLUG PARAMETER FILE\n####"<<endl;
  
  //timestep
  fp_out  << "#Length of time steps (yr or log if log_time > 0)"<<endl;
  fp_out  << "timestep\t\t 2E6 #"<<endl;

  //maxtime
  fp_out  << "#Maximum evolution age (yr) [<1E9]"<<endl;
  fp_out  << "maxtime \t\t 1E9 #"<<endl;

  //log_time
  fp_out  << "#Enable logarithmic timestep [0 or time of first timestep]"<<endl;
  fp_out  << "log_time \t\t 0 #"<<endl;

  //galaxy sfr
  fp_out  << "#Star formation rate (Msun/yr) [-1 for SFH]"<<endl;
  fp_out  << "galaxy_sfr\t\t 1 #"<<endl;
  
  //galaxy SFH
  fp_out  << "#SFH file (time[yr], sfr[M/yr]) [set -1 in SFR]"<<endl;
  fp_out  << "galaxy_sfh\t\t mysfh.txt #"<<endl;
  
  
  //IMF type
  fp_out  << "#IMF [KROUPA, CHABRIER, SALPETER, IGIMF, SLOPE]"<<endl;
  fp_out  << "imf_type\t\t KROUPA #"<<endl;
  
  //IMF slope
  fp_out  << "#IMF_SLOPE if choose SLOPE for IMF, this sets the slope"<<endl;
  fp_out  << "imf_slope\t\t -2.35 #"<<endl;
  
  //Stellar library path
  fp_out  << "#Path to stellar library [iso/padagb/020/lej+smi/maedr]"<<endl;
  fp_out  << "libpath\t\t iso/padagb/020/lej+smi/maedr#"<<endl;

  //Model name
  fp_out  << "#Name of the model"<<endl;
  fp_out  << "model_name\t\t SLUG_DEF #"<<endl;

  //Max mass cluster
  fp_out  << "#Maximum cluster mass [or if you select IGIMF, this is the time interval in years to average the SFR over to determine the maximum cluster mass]"<<endl;
  fp_out  << "max_cluster_mass\t\t 1E7 #"<<endl;
  
  //Minimum cluster mass
  fp_out  << "#Minimum cluster mass"<<endl;
  fp_out  << "min_cluster_mass\t\t 20 #"<<endl;
  
  //Slope CMF
  fp_out  << "#Slope of the cluster mass function"<<endl;
  fp_out  << "slope_cmf\t\t -2 #"<<endl;
  
  //Fraction of clustered stars [0-1]
  fp_out  << "#Fraction of clustered stars [0-1]"<<endl;
  fp_out  << "clust_frac   \t\t  1.0 #"<<endl;

  //control cluster disruption
  fp_out  << "#Cluster disruption parameters, 0 for no disruption [0-1]"<<endl;
  fp_out  << "clust_disrupt   \t\t  1.0 #"<<endl;
  //Type of sampling
  fp_out  << "#Switch between random/sequential drawing [RANDOM,SEQUENIAL]"<<endl;
  fp_out  << "drawtype\t\t RANDOM #"<<endl;
   
  //Seed
  fp_out  << "#Seed to use in the random sequence [0 uses time as seed]"<<endl;
  fp_out  << "seed \t\t 0 #"<<endl;

  //Fluxes to use
  fp_out  << "#Fluxes to compute (comma separated) [NUV,FUV,BOL,QH0,J,H,K,SDSSu,SDSSg,SDSSr,SDSSi,SDSSz,johnsonU,johnsonB,johnsonV,johnsonR,johnsonI]"<<endl;
  fp_out  << "fluxes   \t\t FUV,QH0 #"<<endl;

  //Colors to compute
  fp_out  << "#Colors to compute from the above fluxes (comma separated) [A-C,B-C]"<<endl;
  fp_out  << "colors   \t\t FUV-QH0 #"<<endl;

  //Division in flux
  fp_out  << "#Number of bin in flux to sample (single integer)"<<endl;
  fp_out  << "binflux   \t\t  2 #"<<endl;

  //Division in color
  fp_out  << "#Number of bin in color to sample (single integer)"<<endl;
  fp_out  << "bincolor   \t\t  2 #"<<endl;

  //Maximum in color
  fp_out  << "#Maximum vales for colors, matching the above request (comma separated)"<<endl;
  fp_out  << "maxcolor   \t\t  20 #"<<endl;

  //Minimum in color
  fp_out  << "#Minimum vales for colors, matching the above request (comma separated)"<<endl;
  fp_out  << "mincolor   \t\t  1 #"<<endl;

  //Maximum in flux
  fp_out  << "#Maximum vales for fluxes, matching the above color request (comma separated)"<<endl;
  fp_out  << "maxflux   \t\t  50 #"<<endl;

  //Minimum in flux
  fp_out  << "#Minimum vales for fluxes, matching the above color request (comma separated)"<<endl;
  fp_out  << "minflux   \t\t  1 #"<<endl;

  //Output full cluster file [yes/no]
  fp_out  << "#Output the full cluster file? [yes,no]"<<endl;
  fp_out  << "outcluster   \t\t  no #"<<endl;
  
  //Output full IMF file [yes/no]
  fp_out  << "#Output the full IMF distribution file? [yes,no]"<<endl;
  fp_out  << "imfout   \t\t  no #"<<endl;
  
  //end
  fp_out.close(); 

  exit(2);
}
